﻿using System;
using SchedulerSupreme;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TestSchedule
{
    [TestClass]
    public class TestSchedule
    {
        Schedule schedule;

        static int departments = 1;
        static int types = 6;
        static int days = 65;
        static int slots = 23;

        [TestInitialize]
        public void setup()
        {
            schedule = new Schedule(departments, types, days, slots);
        }

        [TestCleanup]
        public void tearDown()
        {
            
        }

        [TestMethod]
        public void TestAssign()
        {
            for (var department = 0; department < departments; department++)
            {
                for (var type = 0; type < types; type++)
                {
                    for (var day = 0; day < days; day++)
                    {
                        for (var slot = 0; slot < slots; slot++)
                        {
                            Assert.AreEqual(0, schedule.getAssignment(department, type, day, slot));
                            schedule.assign(department, type, day, slot, 1);
                            Assert.AreEqual(1, schedule.getAssignment(department, type, day, slot));
                        }
                    }
                }
            }
        }

        [TestMethod]
        public void TestAssign138()
        {
            // Check that this is an error occurring because of wrong input (i.e. slot = 23)
            Assert.AreEqual(0, schedule.getAssignment(0, 5, 0, 23));
            schedule.assign(0, 5, 0, 23, 1);
            Assert.AreEqual(1, schedule.getAssignment(0, 5, 0, 23));

            Assert.AreEqual(1, schedule.getAssignment(0, 0, 1, 0));
        }

        [TestMethod]
        public void TestAddDepartment()
        {
            int orgLenght = schedule.Size;
            schedule.addDepartments(4);
            int newLenght = schedule.Size;
            Assert.AreEqual(2, 2);
            //Assert.AreEqual(5 * orgLenght, newLenght);
        }
    }
}
